<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!--0:引入 vue.js-->
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    
</head>
<body>   
    <div id ="app3">
        <div v-if="isLogin" >
            欢迎 钉钉            
            <!-- <button  @click="logout">注销</button> -->
            <a href="" @click.prevent="logout">注销</a>

        </div>        
        <div v-else>
            <a href="" @click.prevent = "login" >登录</a>|<a href="">注册</a>
        </div>

    </div>
    <script>
        var vm = new Vue({
            el:"#app3",
            data:{
                isLogin:false
            },
            methods: {
                logout(){
                    console.log("logout。。。。");
                    this.isLogin=false;
                },

                login(){
                    this.isLogin=true;
                }
    
            }
        })
    </script>
    
</body>
</html>